Skip to content

Conversation

@pavelkraleu
Copy link
Contributor

This pull request ensures that the http.HTTPMethod added in Python 3.11 is fully supported in the @action decorator, as mentioned in issue #8995.

Description

Only one test and documentation update is needed, since http.HTTPMethod already functions as is.

The reason for this is that @action already invokes lower() on each method, which converts http.HTTPMethod to a str a format that is already supported.

action

Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my thoughts on this is, do django support this structs as of yet?

@pavelkraleu
Copy link
Contributor Author

my thoughts on this is, do django support this structs as of yet?

That is a very good question.

I have not found any use of http.HTTPMethod in Django.
But for example request.method used in Django returns HTTP method in upper case which is compatible with http.HTTPMethod.

>>> HTTPMethod.GET == "GET"
True

So I think we can say yes, Django supports http.HTTPMethod 🙂

Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm still reluctant to at this right now before knowing the decisions of other maintainers

@auvipy auvipy requested a review from a team August 15, 2023 04:36
Copy link
Contributor

@pauloxnet pauloxnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@auvipy auvipy changed the title Implement support for http.HTTPMethod, which was added in Python 3.11, in the @action Document support for http.HTTPMethod in the @action decorator added in Python 3.11 Aug 15, 2023
@auvipy auvipy changed the title Document support for http.HTTPMethod in the @action decorator added in Python 3.11 Document support for http.HTTPMethod in the @action decorator added in Python 3.11. Aug 15, 2023
@auvipy auvipy merged commit a47adbc into encode:master Aug 15, 2023
@auvipy auvipy added this to the 3.15 milestone Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants